home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / Apps / DevTools / ClassEditor.0.4 / Source / RZBrowserCell.subproj / RZTabStop.m < prev    next >
Encoding:
Text File  |  1995-04-04  |  1.2 KB  |  63 lines

  1. /* 
  2.  * RZTabStop - support object for the RZBrowserCell that represents
  3.  *     a L/R justified or proportional tab-stop
  4.  *
  5.  * You may freely copy, distribute and reuse the code in this example.
  6.  * This code is provided AS IS without warranty of any kind, expressed 
  7.  * or implied, as to its fitness for any particular use.
  8.  *
  9.  * Copyright 1995 Ralph Zazula (rzazula@next.com).  All Rights Reserved.
  10.  *
  11.  */
  12.  
  13. #import "RZTabStop.h"
  14.  
  15. @implementation RZTabStop
  16.  
  17. - init
  18. {
  19.     return [self notImplemented:_cmd];
  20. }
  21.  
  22. - initFixed:(float)pos
  23. {
  24.     return [self initPosition:pos fixed:YES min:0.0 max:0.0];
  25. }
  26.  
  27. - initProportional:(float)pos min:(float)mn max:(float)mx
  28. {
  29.     return [self initPosition:pos fixed:NO min:mn max:mx];
  30. }
  31.  
  32. - initPosition:(float)pos fixed:(BOOL)fix min:(float)mn max:(float)mx
  33. {
  34.     if(self = [super init]) {
  35.         position = pos;
  36.         fixed = fix;
  37.         min = mn;
  38.         max = mx;
  39.     }
  40.     return self;
  41. }
  42.  
  43. - (float)position            { return position; }
  44. - (float)min                { return min; }
  45. - (float)max                { return max; }
  46. - (BOOL)fixed                { return fixed; }
  47.  
  48. - write:(NXTypedStream *)ts
  49. {
  50.     [super write:ts];
  51.     NXWriteTypes(ts, "fffc", &position, &min, &max, &fixed);
  52.     return self;
  53. }
  54.  
  55. - read:(NXTypedStream *)ts
  56. {
  57.     [super read:ts];
  58.     NXReadTypes(ts, "fffc", &position, &min, &max, &fixed);
  59.     return self;
  60. }
  61.  
  62. @end
  63.